//
//  HWFocusGuanzhuCollectionViewCell.m
//  HWanGame
//
//  Created by 陈道斌 on 2020/9/15.
//  Copyright © 2020 Chendaobin. All rights reserved.
//

#import "HWFocusGuanzhuCollectionViewCell.h"


@implementation HWFocusGuanzhuCollectionViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    
    self.beijingView.layer.cornerRadius = 10;
    self.beijingView.layer.masksToBounds = YES;
    self.icoiamageView.contentMode =  UIViewContentModeScaleToFill;
    
   // UIImageView

               self.oneLabel.backgroundColor = [UIColor bm_colorGradientChangeWithSize:CGSizeMake( self.oneLabel.frame.size.width,  self.oneLabel.frame.size.height) direction:IHGradientChangeDirectionLevel startColor:RGB(255, 188, 114) endColor:RGB(255, 43, 69)];
               self.oneLabel.textColor = RGB(255, 255, 255);
    self.oneLabel.layer.cornerRadius = 4;
    self.oneLabel.layer.masksToBounds = YES;
             
               
               
               self.twolabel.backgroundColor = [UIColor bm_colorGradientChangeWithSize:CGSizeMake(self.twolabel.frame.size.width, self.twolabel.frame.size.height) direction:IHGradientChangeDirectionLevel startColor:RGB(255, 242, 217) endColor:RGB(227, 200, 148)];
                  
                 self.twolabel.textColor = RGB(61, 61, 72);
    
    self.twolabel.layer.cornerRadius = 4;
       self.twolabel.layer.masksToBounds = YES;
               
         
               
               
                self.threeLabel.backgroundColor = [UIColor bm_colorGradientChangeWithSize:CGSizeMake(self.threeLabel.frame.size.width, self.threeLabel.frame.size.height) direction:IHGradientChangeDirectionLevel startColor:RGB(124, 174, 255) endColor:RGB(34, 94, 255)];
               
                self.threeLabel.textColor = RGB(255, 255, 255);
        self.threeLabel.layer.cornerRadius = 4;
          self.threeLabel.layer.masksToBounds = YES;
         
      self.xianqingBut.backgroundColor = [UIColor bm_colorGradientChangeWithSizeView: self.xianqingBut];
      self.xianqingBut.layer.cornerRadius = 5;
      self.xianqingBut.layer.masksToBounds = YES;
    
    
    [self.xianqingBut  addTarget:self action:@selector(xianqingButTap) forControlEvents:UIControlEventTouchUpInside];
    
    
    
    
}



-(void)setModel:(CLModel *)model {
    
    _model = model;
    
    
    
    [self.icoiamageView sd_setImageWithURL:[NSURL URLWithString:model.image] placeholderImage:nil];
    
    self.nameLabel.text = [NSString stringWithFormat:@"%@",model.name];
    self.jifenLabel.text = [NSString stringWithFormat:@"%@  %@",model.point,model.type];
    
    
    for (int i = 0; i < model.biaoqian.count; i++) {
        
        if (i == 0 ) {
            
            self.oneLabel.text = model.biaoqian[i];
            
             
        } else if (i == 1) {
            
              self.twolabel.text = model.biaoqian[i];
            
        } else {
            
            
              self.threeLabel.text = model.biaoqian[i];
            
        }
        
        
    }
    
    self.dateLabel.text = [NSString stringWithFormat:@"%@",model.time];
    
    
    
}



- (void)xianqingButTap {
    
   //   NSLog(@"")
    //  self.model.gid
    NSLog(@"11 %@", self.model.gid);
    
    
    HWGameDetailController *game = [[HWGameDetailController alloc]init];
    game.gameId = self.model.gid;
    [[[HWViewUtils  getCurrentVC] navigationController]  pushViewController:game animated:YES];
    
    
    
    
    
}
@end
